//对外暴露配置路由(常量路由):全部用户都可以访问到的路由
export const constantRoute = [
  {
    path: '/:pathMatch(.*)*',
    component: () => import('@/views/404/index.vue'),
    meta: {
      hidden: true,
    },
  },
  {
    //登录成功以后展示数据的路由
    path: '/',
    component: () => import('@/layout/index.vue'),
    name: 'layout',
    meta: {
      title: '首页',
      hidden: false,
      icon: '',
    },
    children: [
      {
        path: '/',
        name: 'home',
        component: () => import('@/views/home/index.vue'),
        meta: { title: '首页' },
      },
    ],
  },
]

//异步路由
export const asnycRoute = [
  {
    path: '/课程',
    component: () => import('@/layout/index.vue'),
    redirect: '/course',
    name: 'course',
    meta: { title: '课程' },
    children: [
      {
        path: '/course',
        name: 'course',
        component: () => import('@/views/course/index.vue'),
        meta: { title: '课程' },
      },
      {
        path: '/course/:courseId',
        name: 'courseInfo',
        component: () => import('@/views/course/info.vue'),
        meta: { title: '课程详情' },
      },
    ],
  },
  {
    path: '/teacher',
    component: () => import('@/layout/index.vue'),
    redirect: '/teacher',
    name: 'teacher',
    meta: { title: 'teacher' },
    children: [
      {
        path: '/teacher',
        name: 'teacher',
        component: () => import('@/views/teacher/index.vue'),
        meta: { title: '讲师' },
      },
      {
        path: '/teacher/:teacherId',
        name: 'teacherInfo',
        component: () => import('@/views/teacher/info.vue'),
        meta: { title: '讲师详情' },
      },
    ],
  },
  {
    path: '/ai',
    component: () => import('@/layout/index.vue'),
    redirect: '/ai',
    name: 'ai',
    meta: { title: 'ai' },
    children: [
      {
        path: '/ai',
        name: 'ai',
        component: () => import('@/views/ai/index.vue'),
        meta: { title: 'AI问答' },
      },
    ],
  },
  /* {
    path: '/qa',
    component: () => import('@/layout/index.vue'),
    redirect: '/qa',
    name: 'qa',
    meta: { title: '问答' },
    children: [
      {
        path: '/qa',
        name: '问答',
        component: () => import('@/views/qa/index.vue'),
        meta: { title: '问答' },
      },
      {
        path: '/qa/:id',
        name: 'qaInfo',
        component: () => import('@/views/qa/info.vue'),
        meta: { title: '问答详情' },
      },
    ],
  }, */
]
